package com.zj.study.test;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author 赵赳
 * @since 2022/2/10 17:41
 */
public class HelloWorld {

  public static void main(String[] args) {
    //System.out.println("hello world!");
    var now = LocalDateTime.now();
    DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    //var format = dtf.format(now);
    //var substring = format.substring(0,8);
    //System.out.println("substring = " + substring);

    var dateTime = LocalDateTime.parse("2022-01-13 23:59:59", dtf);
    System.out.println("dateTime = " + dateTime);

    var localDate = dateTime.toLocalDate();
    System.out.println("localDate = " + localDate);

  }

}
